﻿@using Devonline.AspNetCore;
@inject Microsoft.AspNetCore.Http.IHttpContextAccessor _httpContextAccessor;
@{
    var isLogin = _httpContextAccessor.HttpContext?.User?.Identity?.IsAuthenticated ?? false;
    var name = _httpContextAccessor.HttpContext?.User?.Identity?.Name;
}

<header id="_header_" class="header body-content">
    <nav class="navbar navbar-default header-navigation">
        <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">
            <img src="~/icons/identity.png">统一认证与授权中心
        </a>

        <ul class="nav navbar-nav navbar-right user-info">
            @if (isLogin)
            {
                <li class="nav-item">
                    <a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Profile">[@name]</a>
                </li>
            }
            else
            {
                <li class="nav-item">
                    <a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Login">[ 登陆 ]</a>
                </li>
            }

            <li class="nav-item">
                <a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Logout">[ 注销 ]</a>
            </li>
        </ul>

        <ul class="nav nav-pills user-menu">
        </ul>
    </nav>
</header>